
const list = [
  
];
let arrProxy = new Proxy(list, {
    set(targer, property, value) {
        targer[property] = value
        return true  //返回写入成功
    }
})

arrProxy.push(200)
arrProxy.push({ name: 'test' })
console.log(list)

Object.defineProperty(list, 'name', {

    get(targer, property) {
        return property in targer ? targer[property] : 'default'
    }
})
console.log(list.name)